#!/bin/bash
export HF_ENDPOINT=https://hf-mirror.com
name=$(basename "$1")
# 网络好的时候，一下子下载完了
# huggingface-cli download  --token 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 --resume-download --local-dir-use-symlinks False $1 # --local-dir $name

# 网络不好的时候，就要下载很多回，目测每3分钟卡死一回
# name=$(basename "$1")
while true
do
    timeout 60 huggingface-cli download  --token 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 --resume-download --local-dir-use-symlinks False $1 # --local-dir $name
    #  --local-dir $name 这个在循环使用的时候可能会出问题
done

# rsync -avzh --exclude='*.log' liyaze@192.168.6.137:/home/FAST_DATA_MIRROR/Langchain-Chatchat-master/ /home/FAST_DATA_MIRROR/Langchain-Chatchat-master/
# rsync -avzh liyaze@192.168.6.137:/home/liyaze/.cache/huggingface/modules/transformers_modules/THUDM/chatglm3-6b/ /home/liyaze/.cache/huggingface/modules/transformers_modules/THUDM/chatglm3-6b/
# rsync -avzh liyaze@192.168.6.137:/home/liyaze/.cache/huggingface/hub/models--THUDM--chatglm3-6b/ /home/liyaze/.cache/huggingface/hub/models--THUDM--chatglm3-6b/

